﻿using System;
using System.Threading.Tasks;

namespace Innovative.Atom.Timer.Event
{
	public interface IAtomEvent
	{
		event EventHandler<AtomExceptionEventArgs> TaskErrorOccurred;
		event EventHandler<AtomGetTaskEventArgs> GetNextTask;

		DateTime CreatedDateTime { get; }
		string EventName { get; set; }
		DateTime EventDateTime { get; }
		TimeSpan TaskDueTime { get; }
		Task<bool> EventTask { get; set; }
		long EventId { get; }
		object State { get; set; }
		void InitializeNextEventDateTime();
		void UpdateNextEventDateTime();		
		void RequestNextTask();
		void TaskStarting(AtomEventData atomEventData);		
		void TaskError(AtomException taskException);
		void TaskCompleted();
		bool TaskIsExpired { get; }
	}
}
